package com.by.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.annotation.WebServlet;
import java.util.HashMap;
import java.util.Map;

/**
 * @author LittleDesire
 * @description
 * @date 2022-03-23 周三 15:14
 * @since 17
 */
@RestController
public class DController {
    @RequestMapping("/pp")
    public Map<String, Object> pp(Integer id , String name) {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("name",name);
        System.out.println(map);
        // 没有jackson组件
        return null;
    }


    @RequestMapping("/m")
    @CrossOrigin
    public Map<String, Object> m(@RequestBody String msg) {
        System.out.println(msg);
        return null;
    }

    @RequestMapping("/m1")
    @CrossOrigin
    public Map<String, Object> m1(@RequestBody Map<String,Object> map) {
        System.out.println(map);
        return map;
    }
}
